home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Adobe Graphics & Publishing SDK 1996 December
/
Adobe Graphics & Publishing SDK 1996 December.iso
/
pc
/
ps40sdk
/
examples
/
resources
/
fileutilities.c
< prev
next >
Wrap
Text File
|
1996-06-05
|
1KB
|
69 lines
/*
File: FileUtilities.c
Copyright 1990 by Thomas Knoll.
Copyright 1993-1996 by Adobe Systems, Inc.
C source file for file utilities.
*/
/*****************************************************************************/
#include "PITypes.h"
#include "PIGeneral.h"
#include "FileUtilities.h"
/*****************************************************************************/
void AppendStringAndString (Str255 s, Str255 append)
{
unsigned16 sLength = s [0];
unsigned16 totalLength = sLength + ((unsigned16) (append [0]));
if (totalLength > 255)
totalLength = 255;
if (totalLength > sLength)
{
BlockMove (&(append[1]), &(s[sLength+1]), totalLength - sLength);
s [0] = (unsigned char) totalLength;
}
}
/***************************************************************************/
void AppendCharAndString (Handle h, Str255 append)
{
unsigned16 hLength = 0; // HostGetHandleSize( gStuff->handleProcs, h );
unsigned16 totalLength = hLength + ((unsigned16) (append [0]));
if (totalLength > 255)
totalLength = 255;
if (totalLength > hLength)
{
BlockMove (&(append[1]), &(h[0]), totalLength - hLength);
h[totalLength] = '\0';
//BlockMove (&(append[1]), &(h[hLength+1]), totalLength - sLength);
//s [0] = totalLength;
}
}
/*****************************************************************************/
void AppendStringAndCharacter (Str255 s, unsigned char c)
{
if (s [0] < 255)
{
++(s [0]);
s [s [0]] = c;
}
}